const express = require('express')
const app = express()

const port = 4000


const cors = require("cors")
const bodyparser = require('body-parser')
// 跨域共享资源
app.use(cors())
app.use(bodyparser.json())
app.use(bodyparser.urlencoded({ extended: true }))

// 引用routes里面自己写的接口
// app.use(require("./routes/index"))

app.get('/', (req, res) => res.send('Hello World!'))
app.listen(port, () => console.log(`Example app listening on port ${port}!`))